package com.acsior.hibernate.vo;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.acsior.dac.impl.hibernate.vo.GeneratorKey;
import com.acsior.dac.impl.hibernate.vo.HibernatePersistantIntegerIdVO;

/**
 * Стойност на услуга
 * 
 * @author Г. Белев 29.09.2011
 */
@Entity
@Table(name = "service_prices")
@GeneratorKey(tableName = "service_prices")
public class ServicePriceVO extends HibernatePersistantIntegerIdVO {

	private static final long serialVersionUID = 4111279498132793707L;

	@Column(name = "additional_value", length = 50)
	private String additionalValue;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "customer_contract_id")
	private CustomerContractVO customerContract;

	@Column(name = "dds", nullable = false, scale = 4)
	private double dds;

	@Column(name = "discount", nullable = false, precision = 10)
	private double discount;

	@Column(name = "event_date", nullable = false, length = 23)
	private Date eventDate;

	@Column(name = "expense", nullable = false)
	private boolean expense;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "invoice_id")
	private InvoiceVO invoice;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "nom_cash_type_id", nullable = false)
	private NomCashTypeVO nomCashType;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "nom_service_extra_id", nullable = false)
	private NomServiceExtraVO nomServiceExtra;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "payment_order_id")
	private PaymentOrderVO paymentOrder;

	@Column(name = "post_stamps", nullable = false, scale = 4)
	private double postStamps;

	@Column(name = "price", nullable = false, scale = 4)
	private double price;

	@Column(name = "quantity", nullable = false)
	private Integer quantity;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "service_request_id", nullable = false)
	private ServiceRequestVO request;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "stock_item_id")
	private StockItemVO stockItem;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "subscription_plan_id")
	private SubscriptionPlanVO subscriptionPlan;

	@Column(name = "vat_rate", nullable = false, length = 10)
	private String vatRate;

	/**  */
	public ServicePriceVO() {
		super();
	}

	/** @return the additionalValue */
	public String getAdditionalValue() {
		return this.additionalValue;
	}

	/** @return the customerContract */
	public CustomerContractVO getCustomerContract() {
		return this.customerContract;
	}

	/** @return the dds */
	public double getDds() {
		return this.dds;
	}

	/** @return the discount */
	public double getDiscount() {
		return this.discount;
	}

	/** @return the eventDate */
	public Date getEventDate() {
		return this.eventDate;
	}

	/** @return the invoice */
	public InvoiceVO getInvoice() {
		return this.invoice;
	}

	/** @return the nomCashType */
	public NomCashTypeVO getNomCashType() {
		return this.nomCashType;
	}

	/** @return the nomServiceExtra */
	public NomServiceExtraVO getNomServiceExtra() {
		return this.nomServiceExtra;
	}

	/** @return the paymentOrder */
	public PaymentOrderVO getPaymentOrder() {
		return this.paymentOrder;
	}

	/** @return the postStamps */
	public double getPostStamps() {
		return this.postStamps;
	}

	/** @return the price */
	public double getPrice() {
		return this.price;
	}

	/** @return the quantity */
	public Integer getQuantity() {
		return this.quantity;
	}

	/** @return the request */
	public ServiceRequestVO getRequest() {
		return this.request;
	}

	/** @return the stockItem */
	public StockItemVO getStockItem() {
		return this.stockItem;
	}

	/** @return the subscriptionPlan */
	public SubscriptionPlanVO getSubscriptionPlan() {
		return this.subscriptionPlan;
	}

	/** @return the vatRate */
	public String getVatRate() {
		return this.vatRate;
	}

	/** @return the expense */
	public boolean isExpense() {
		return this.expense;
	}

	/**
	 * @param additionalValue
	 *            the additionalValue to set
	 */
	public void setAdditionalValue(String additionalValue) {
		this.additionalValue = additionalValue;
	}

	/**
	 * @param customerContract
	 *            the customerContract to set
	 */
	public void setCustomerContract(CustomerContractVO customerContract) {
		this.customerContract = customerContract;
	}

	/**
	 * @param dds
	 *            the dds to set
	 */
	public void setDds(double dds) {
		this.dds = dds;
	}

	/**
	 * @param discount
	 *            the discount to set
	 */
	public void setDiscount(double discount) {
		this.discount = discount;
	}

	/** @param eventDate */
	public void setEventDate(Date eventDate) {
		this.eventDate = eventDate;
	}

	/**
	 * @param expense
	 *            the expense to set
	 */
	public void setExpense(boolean expense) {
		this.expense = expense;
	}

	/**
	 * @param invoice
	 *            the invoice to set
	 */
	public void setInvoice(InvoiceVO invoice) {
		this.invoice = invoice;
	}

	/**
	 * @param nomCashType
	 *            the nomCashType to set
	 */
	public void setNomCashType(NomCashTypeVO nomCashType) {
		this.nomCashType = nomCashType;
	}

	/**
	 * @param nomServiceExtra
	 *            the nomServiceExtra to set
	 */
	public void setNomServiceExtra(NomServiceExtraVO nomServiceExtra) {
		this.nomServiceExtra = nomServiceExtra;
	}

	/**
	 * @param paymentOrder
	 *            the paymentOrder to set
	 */
	public void setPaymentOrder(PaymentOrderVO paymentOrder) {
		this.paymentOrder = paymentOrder;
	}

	/** @param postStamps */
	public void setPostStamps(double postStamps) {
		this.postStamps = postStamps;
	}

	/**
	 * @param price
	 *            the price to set
	 */
	public void setPrice(double price) {
		this.price = price;
	}

	/**
	 * @param quantity
	 *            the quantity to set
	 */
	public void setQuantity(Integer quantity) {
		this.quantity = quantity;
	}

	/**
	 * @param request
	 *            the request to set
	 */
	public void setRequest(ServiceRequestVO request) {
		this.request = request;
	}

	/**
	 * @param stockItem
	 *            the stockItem to set
	 */
	public void setStockItem(StockItemVO stockItem) {
		this.stockItem = stockItem;
	}

	/**
	 * @param subscriptionPlan
	 *            the subscriptionPlan to set
	 */
	public void setSubscriptionPlan(SubscriptionPlanVO subscriptionPlan) {
		this.subscriptionPlan = subscriptionPlan;
	}

	/**
	 * @param vatRate
	 *            the vatRate to set
	 */
	public void setVatRate(String vatRate) {
		this.vatRate = vatRate;
	}
}
